package com.mall.service;

import com.mall.mapper.goodsMapper;
import com.mall.pojo.goods;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

//处理新鲜好物和热门推荐模块
@Service
public class homeGoodsService {
    @Autowired
    private goodsMapper goodsMapper;
    public List<goods> goodsNew() {
        //待处理
        return goodsMapper.findNew();
    }
    public List<goods> goodsHot() {
        //待处理
        return goodsMapper.findHot();
    }
    public goods getGoodById(int id) {
        return  goodsMapper.findById(id);
    }
    public List<goods> findGoodsByParentId(int parentId) {return goodsMapper.findByParentId(parentId);}
    public List<goods> findGoodsBySubId(int subId) {return goodsMapper.findBySubId(subId);}
}
